package com.watson.s2sh.dao;

import javax.persistence.EntityManager;
import javax.persistence.PersistenceContext;

import org.springframework.transaction.annotation.Propagation;
import org.springframework.transaction.annotation.Transactional;

import com.watson.s2sh.domain.Book;

@Transactional
public class BookDao {

	@PersistenceContext  
    private EntityManager em; 
	
	@Transactional(propagation = Propagation.REQUIRED)  
    public void save(Book o){  
        em.persist(o);  
    }  
      
    @Transactional(propagation = Propagation.REQUIRED)  
    public Book get(Object id){  
        return em.find(Book.class, id);  
    }  
}
